package com.zhy.http.okhttp.builder;

import com.zhy.http.okhttp.request.PostFormRequest;
import com.zhy.http.okhttp.request.RequestCall;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class PostFormBuilder extends OkHttpRequestBuilder
{
  private List<FileInput> files = new ArrayList();

  public PostFormBuilder addFile(String paramString1, String paramString2, File paramFile)
  {
    this.files.add(new FileInput(paramString1, paramString2, paramFile));
    return this;
  }

  public PostFormBuilder addHeader(String paramString1, String paramString2)
  {
    if (this.headers == null)
      this.headers = new LinkedHashMap();
    this.headers.put(paramString1, paramString2);
    return this;
  }

  public PostFormBuilder addParams(String paramString1, String paramString2)
  {
    if (this.params == null)
      this.params = new LinkedHashMap();
    this.params.put(paramString1, paramString2);
    return this;
  }

  public RequestCall build()
  {
    return new PostFormRequest(this.url, this.tag, this.params, this.headers, this.files).build();
  }

  public PostFormBuilder headers(Map<String, String> paramMap)
  {
    this.headers = paramMap;
    return this;
  }

  public PostFormBuilder params(Map<String, String> paramMap)
  {
    this.params = paramMap;
    return this;
  }

  public PostFormBuilder tag(Object paramObject)
  {
    this.tag = paramObject;
    return this;
  }

  public PostFormBuilder url(String paramString)
  {
    this.url = paramString;
    return this;
  }

  public static class FileInput
  {
    public File file;
    public String filename;
    public String key;

    public FileInput(String paramString1, String paramString2, File paramFile)
    {
      this.key = paramString1;
      this.filename = paramString2;
      this.file = paramFile;
    }

    public String toString()
    {
      return "FileInput{key='" + this.key + '\'' + ", filename='" + this.filename + '\'' + ", file=" + this.file + '}';
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.zhy.http.okhttp.builder.PostFormBuilder
 * JD-Core Version:    0.6.2
 */